programming4us
           
 
 
Windows Server

Configuring Internet Information Services (part 4)

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
12/10/2010 11:33:01 AM

Working with Virtual Directories

A common requirement within Web sites is to include content from folders that are located outside of the Web site’s primary folder structure. For example, multiple Web sites that share the same set of images might need to access a pointer to a single path from which they can all access files. Virtual directories are designed to provide this capability. Virtual directories can be created at either the level of a Web site or within a specific Web application. They include an alias name (which will be used in the requesting URL) and point to a physical file system location path.

Creating a Virtual Directory

The process of creating a virtual directory is similar to that of creating a Web application. In IIS Manager, right-click the appropriate parent Web site or Web application and then select Add Virtual Directory. You will be able to provide an alias for the virtual directory (such as Images), along with security credentials and the physical path to the virtual directory. When a request is received for this alias, IIS will look in the appropriate file system location automatically for the requested content.

Comparing Virtual Directories and Web Applications

Although the settings for a virtual directory are similar to those of a Web application, there are some differences in their usage. Web Applications are generally designed to support executable Web code such as applications built using ASP.NET. They run within an isolated process space, using WAS. The reliance on WAS also enables Web applications to respond using protocols other than HTTP and HTTPS (assuming that other protocols have been installed and configured on the local server).

Virtual directories, on the other hand, are primarily used to point to static content that is stored in an alternate file system location. Both Web applications and virtual directories form a portion of the complete URL that is used to access a Web site. They can also both be nested to provide access to multiple levels of site content. The more appropriate choice will be based on the requirements of the Web application that you plan to support.

More Info: Keeping the configuration simple

Web applications and virtual directories offer a lot of power and flexibility for both Web server administrators and Web developers. In general, try to keep your configurations as simple and intuitive as possible. For example, although both types of objects can be nested within each other, complex nesting can be confusing (especially if some of the objects share the same names). Overall, keep management of the Web site in mind when creating and designing the site structure.


Using Command-Line Management

Performing simple administrator tasks on a few IIS servers is a relatively simple process, using the IIS Manager console. However, when you want to commit the same changes on many different servers, or you want to automate the configuration process by using scripting, command-line utilities can make these tasks more efficient. IIS includes an executable command, AppCmd.exe, which provides a simple way for systems administrators to perform common operational tasks. The actual parameters are designed to map to the structure of IIS Web sites, Web applications, and virtual directories.

The AppCmd.exe file is located within the %SystemRoot%\System32\Inetsrv folder. You can get initial help for the utility by running the command with the -/? switch. (See Figure 18.) You can use the same switch to get additional details about other commands. The general syntax for the command is:

AppCmd.exe Command Object "ObjectName" /parameter:value

Figure 18. Viewing help for the AppCmd.exe utility


Understanding Command Options

AppCmd has been designed to use a simple set of six commands for performing tasks on objects. The list of commands includes:

  • List Returns information about the specified object.

  • Add Creates a new object of the type that is specified. Details can be added, using parameters and values.

  • Delete Deletes the specified object (such as a Web site or Web application).

  • Set Changes settings for the object, as specified by the parameters and values.

  • Start / Stop Available for objects that support these actions (such as a Web site).

If you want to perform multiple operations (either from a script file or from the command line), you will need to call AppCmd.exe for each operation. This helps keep the syntax of the statements simple and easy to read.

Understanding Objects

In a standard AppCmd statement, you will need to provide an object type and the name of the object that you plan to use. The types of objects supported by AppCmd.exe include the following:

  • App (Web Application)

  • AppPool (Application Pool)

  • Backup (Server configuration backups)

  • Config (Server configuration information)

  • Module

  • Request

  • Site (Web Site)

  • Trace

  • VDir (Virtual Directory)

  • WP (Worker Process)

You can get more information about the parameters and values that apply to an object by typing -? after the command.

Appcmd site -?

Examples of Commands

The process of listing, creating, and managing IIS configuration settings by using AppCmd is generally fairly simple. Table 1 provides some examples of common commands and their purpose.

Table 1. Sample Commands for AppCmd.exe
CommandPurpose
AppCmd list siteReturns a list of Web sites on the local server
AppCmd add site /name:TestSite01Adds a new Web site called TestSite01
AppCmd add vdir /app.name:"Default Web Site/"
/path:/Images /physicalPath:"C:\Inetpub\wwwroot\images"

Adds a new virtual directory with the alias Images and points to the specified physical file system location
AppCmd list requestReturns a list of currently running Web server requests
AppCmd list configReturns the entire contents of the current Web server configuration in XML format


Using Windows PowerShell

In addition to using the AppCmd utility, Web server administrators can use the command shell and scripting language, Microsoft Windows PowerShell. Windows Server 2008 includes Windows PowerShell as a feature, but it is not enabled by default. To enable Windows PowerShell, open Server Manager, right-click Features, and select Add Feature. Select the Windows PowerShell option, and then click Next to finish installing it. Once it has been installed, you can launch it from within the Windows PowerShell 1.0 program group in the Start menu. Windows PowerShell enables you to write and create powerful scripts for performing many common administration operations.

More Info: Learning Windows PowerShell

Although a complete description of how to use PowerShell is beyond the scope of this book (and Exam 70-643), you can find more information about using it to manage IIS by searching for Powershell at http://www.iis.net. The Microsoft TechNet Scripting with Windows PowerShell Web site offers tutorials and examples for creating new scripts at http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx.


Automation Using .NET Framework

Many Web developers already have a significant amount of knowledge about working with the .NET Framework. Therefore, it can be helpful for them to manage IIS by using standard .NET code. IIS 7.0 provides two .NET namespaces that can be used to manage IIS configuration settings programmatically. They are:

  • Microsoft.Web.Administration This namespace provides objects and methods that are useful for managing and changing Web server settings. It is focused primarily on performing configuration changes for an IIS Web server.

  • Microsoft.Web.Management Although the default IIS Manager user interface has been designed to provide simple access to the majority of commonly used functionality, some environments might want to create their own management extensions for performing specific tasks. The Microsoft.Web.Management namespace includes objects and methods that enable developers to extend the user interface functionality of IIS management tools. These additions can then be configured to run in a standalone environment, or they can be integrated with the built-in IIS Manager utility for easy access.

Understanding how to write applications by using the .NET Framework is beyond the scope of Exam 70-643, but it can be helpful to know that these options are available for automating configuration and management tasks. Additional information about the namespaces mentioned here and others can be found at http://msdn2.microsoft.com/en-us/library/aa388745.aspx.

Other -----------------
- Windows Server 2008 : Installing the Web Server Role (part 9) - Using Windows System Resource Manager
- Windows Server 2008 : Installing the Web Server Role (part 8)
- Windows Server 2008 : Installing the Web Server Role (part 7)
- Windows Server 2008 : Installing the Web Server Role (part 6)
- Windows Server 2008 : Installing the Web Server Role (part 5)
- Windows Server 2008 : Installing the Web Server Role (part 4)
- Windows Server 2008 : Installing the Web Server Role (part 3)
- Windows Server 2008 : Installing the Web Server Role (part 2)
- Windows Server 2008 : Installing the Web Server Role (part 1)
- Windows Server 2008 : Recovering Role Services and Features (part 4)
- Windows Server 2008 : Recovering Role Services and Features (part 3)
- Windows Server 2008 : Recovering Role Services and Features (part 2) - System State Recovery for Domain Controllers
- Windows Server 2008 : Recovering Role Services and Features (part 1)
- Windows Server Backup Volume Recovery (part 3) - System Volume Recovery Using Network Shared Folder Backups
- Windows Server Backup Volume Recovery (part 2) - Windows Server 2008 R2 System Volume Recovery
- Windows Server Backup Volume Recovery (part 1) - Windows Server 2008 R2 Data Volume Recovery
- Managing and Accessing Windows Server Backup Media
- Windwos Server 2008 : Recovering from a Server or System Failure (part 3)
- Windwos Server 2008 : Recovering from a Server or System Failure (part 2) - Enabling Auditing for NTFS Folders
- Windwos Server 2008 : Recovering from a Server or System Failure (part 1)
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us